package com.techprimers.mongodb.springbootmongodbexample.repository;

import com.techprimers.mongodb.springbootmongodbexample.document.DeviceStatusHistory;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import java.util.List;

public interface DeviceStatusHistoryRepository extends MongoRepository<DeviceStatusHistory, String> {

    @Query(value = "{'device_id':'?0'}",fields = "{'device_id':1,'pack_timestamp':1,'status_history.coordinate':1,'status_history.network.ssid':1}")
    List<DeviceStatusHistory> find(String deviceId);
}
